USE ERP_DB

go
create view v_productsStatView
as 

SELECT  COUNT(*) AS value, pt.TypeName AS name
FROM      dbo.t_Products AS p RIGHT OUTER JOIN
                   dbo.t_ProductsType AS pt ON p.TypeID = pt.TypeID
GROUP BY pt.TypeName